-
-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TASK: Provide alternative for NodeDiscriminator::fromNode
that doesnt use Nodes content stream
#5144
TASK: Provide alternative for NodeDiscriminator::fromNode
that doesnt use Nodes content stream
#5144
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
We cannot rely on $this->currentContentStreamId being the matching one for $this->currentNode, because the step `I expect a node identified by live-cs-identifier;lady-eleonode-nodesworth;{} to exist in the content graph` can initialize a foreign node!
Okay so i tried 3 different ways of achieving the goal (not to use $node->subgraphIdentity->contentStreamId) and im now kinda happy with the last attempt of introducing a Horray 🥳 |
0d3bc77
to
6101daf
Compare
…`ContentStreamAwareNode`
6101daf
to
eef4166
Compare
/** Alias for $currentNode->instance->aggregateId */ | ||
public NodeAggregateId $aggregateId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that way we dont need to rewrite too much code ...
$subgraph = $this->getCurrentSubgraph(); | ||
|
||
$parent = $subgraph->findParentNode($currentNode->aggregateId); | ||
Assert::assertInstanceOf(Node::class, $parent, 'Parent not found.'); | ||
$actualParentDiscriminator = NodeDiscriminator::fromNode($parent); | ||
$actualParentDiscriminator = NodeDiscriminator::fromNode($currentNode->builder()->buildNode($parent)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternative: ... if we dislike the god object
$actualParentDiscriminator = NodeDiscriminator::fromNode($currentNode->builder()->buildNode($parent)); | |
$actualParentDiscriminator = NodeDiscriminator::fromNode(ContentStreamAwareNodeBuilder::fromNode($currentNode)->buildNode($parent)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We agreed not to have this kind of DTOs today (see #5034 (comment))
Closing in favour of #5169 |
Related #5034 and #5043
Upgrade instructions
Review instructions
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions